import json
import zipfile

def get_data(args):
    data = []
    with open(args.input_dir, 'r', encoding='utf-8') as f:
        for line in f:
            item = json.loads(line)
            data.append(item)
    return data

def save_data(output, args):
    with open(f'{args.output_dir}.json', 'w') as f:
        json.dump(output, f)
    with zipfile.ZipFile(f"{args.output_dir}.zip", "w", zipfile.ZIP_DEFLATED) as zipf:
        zipf.write(f"{args.output_dir}.json")